<template>
  <div id="app">
    <el-container>
      <el-header class="el_header">
        <!--头里放个大的轮播图-->
        <el-carousel height="220px" direction="vertical" :autoplay="true">
          <el-carousel-item v-for="item in images" :key="item">
            <img class="bannner_img" :src="item"/>
          </el-carousel-item>
        </el-carousel>
      </el-header>
      <!--主题-->
      <el-main class="el_main">
        <el-row :gutter="4" class="row_one">
          <el-col :xs="6" :sm="6" :md="6" :lg="6" :xl="1">
            <div class="grid-content bg-purple">
              科技
            </div>
          </el-col>
          <el-col :xs="6" :sm="6" :md="6" :lg="6" :xl="11">
            <div class="grid-content bg-purple-light">
              文学
            </div>
          </el-col>
          <el-col :xs="6" :sm="6" :md="6" :lg="6" :xl="11">
            <div class="grid-content bg-purple">
              历史
            </div>
          </el-col>
          <el-col :xs="6" :sm="6" :md="6" :lg="6" :xl="1">
            <div class="grid-content bg-purple-light">
              生活
            </div>
          </el-col>
        </el-row>
        <el-row :gutter="4" class="row_two">
          <el-col :xs="6" :sm="6" :md="6" :lg="6" :xl="1">
            <div class="grid-content bg-purple">
              曲艺
            </div>
          </el-col>
          <el-col :xs="6" :sm="6" :md="6" :lg="6" :xl="11">
            <div class="grid-content bg-purple-light">
              杂谈
            </div>
          </el-col>
          <el-col :xs="6" :sm="6" :md="6" :lg="6" :xl="11">
            <div class="grid-content bg-purple">
              相声
            </div>
          </el-col>
          <el-col :xs="6" :sm="6" :md="6" :lg="6" :xl="1">
            <div class="grid-content bg-purple-light">
              小品
            </div>
          </el-col>
        </el-row>
        <!--listview-->
        <ul class="infinite-list" v-infinite-scroll="load" style="overflow:auto">
          <li v-for="i in count" class="infinite-list-item">

            <el-card :body-style="{ padding: '0px' }">
              <img src="https://shadow.elemecdn.com/app/element/hamburger.9cf7b091-55e9-11e9-a976-7f4d0b07eef6.png" class="image">
              <div style="padding: 14px;">
                <span>好吃{{ i }}的</span>
              </div>
            </el-card>
          </li>
        </ul>


      </el-main>
    </el-container>
    <!--<router-view/>-->
  </div>
</template>

<script>
  export default {
    name: 'App',
    data() {
      return {
        images: [require('./assets/1.jpeg'),
          require('./assets/2.jpeg'),
          require('./assets/3.jpeg'),
          require('./assets/4.jpeg'),
          require('./assets/5.jpeg'),
          require('./assets/6.jpeg')
        ],
        count: 0
      }
    },
    methods: {
      load () {
        if(this.count==6){
          this.count=6
        }else {
          this.count += 2

        }


      }
    }

  }
</script>

<style>
  * {
    margin: 0px;
    padding: 0px;
  }

  #app {
    font-family: 'Avenir', Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-align: center;
    color: #2c3e50;

  }

  #app .el_header {
    height: 220px !important;
    background-color: transparent;
    padding: 0px;
  }

  /*轮播图*/

  .bannner_img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  /*主题*/

  .el-main{
    padding: 4px 4px 4px 4px;
  }
  /*第二row*/
  .row_two{
    padding-top: 4px;
  }

  .el-col {
    border-radius: 6px;
  }
  .bg-purple-dark {
    background: white;
  }
  .bg-purple {
    background: #5daf34;
  }
  .bg-purple-light {
    background: #85ce61;
  }
  .grid-content {

    border-radius: 4px;
    min-height: 50px;
    margin: 0 auto;
    line-height: 60px;
    vertical-align: middle;
    color: #000;
    font-size: x-large;
    border: 1px solid gray;
  }

  /*listview*/
  .infinite-list{
    margin-top: 10px;
  }
  .infinite-list .infinite-list-item .image{
    width: 100%;
    height: 200px;
    object-fit: cover;
  }


</style>


